package user.moudle.classes
{
	import mx.rpc.remoting.mxml.RemoteObject;
	
	import user.moudle.interfaces.IUser;
	
	import util.RemoteObjectUtil;

	public class UserImpl implements IUser
	{
		private var remote:RemoteObjectUtil=new RemoteObjectUtil();
		
		public function UserImpl()
		{
		}

		public function login(userName:String, password:String, resultEvent:Function):void
		{
			var opera:RemoteObject=remote.createRemoteObject("userFlex",resultEvent,null);
			opera.login(userName,password);
		}
		
		public function findAllUsers(resultEvent:Function):void
		{
			var opera:RemoteObject=remote.createRemoteObject("userFlex",resultEvent,null);
			opera.findAllUsers();
		}
		public function addUser(userName:String,password:String, resultEvent:Function):void{
			var opera:RemoteObject=remote.createRemoteObject("userFlex",resultEvent,null);
			opera.addUser(userName,password);
		}
		public function editUser(id:String, userName:String,password:String,resultEvent:Function):void{
			var opera:RemoteObject=remote.createRemoteObject("userFlex",resultEvent,null);
			opera.editUser(id,userName,password);
		}
		public function delUser(id:String, resultEvent:Function):void{
			var opera:RemoteObject=remote.createRemoteObject("userFlex",resultEvent,null);
			opera.delUser(id);
		}
		public function queryUser(whereSql:String,resultEvent:Function):void{
			var opera:RemoteObject=remote.createRemoteObject("userFlex",resultEvent,null);
			opera.queryUser(whereSql);
		}
	}
}